package com.study.utils;


import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 * 将图片加载到内存中的工具类
 * @Author ZhuHJay
 * @Date 2021/9/14 19:54
 */
public class ImageReader {

    /** 加载图片到内存中, 根据相对路径获取 **/
    public static BufferedImage loaderImage(String relativePath) throws IOException {
        return ImageIO.read(ImageReader.class.getClassLoader().getResourceAsStream(relativePath));
    }

}
